package com.lx.design.demo.learning.liu.strategy;

import lombok.Data;
import org.springframework.stereotype.Component;

/**
 * @author lx
 * @date 2021/3/1 13:23
 */
@Data
//@Component
public class Notice {
    /**
     * 通知内容
     */
    private String msg;

    /**
     * 通知方式
     */
    private NoticeWay noticeWay;

    public Notice(String msg, NoticeWay noticeWay) {
        this.msg = msg;
        this.noticeWay = noticeWay;
    }

    public void push (){
        this.noticeWay.notice(msg);
    }
}
